import http from './index.js';

/**
 * 添加购物车
 * @param {*} gid
 */
export const add = (gid) => http.post(`/carts`, { gid });

/**
 * 获取购物车列表
 * @returns
 */
export const getList = () => http.get('/carts');

/**
 * 修改购物车商品数量
 * @param {*} gid
 * @param {*} num
 * @returns
 */
export const update = (gid, num) => http.put('/carts', { gid, num });

/**
 * 删除购物车商品
 * @param {*} gid
 * @returns
 */
export const remove = (gid) => http.delete('/carts', { params: { gid } });
